(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{205:function(t,e,r){"use strict";r.r(e),function(t,n){r.d(e,"Authentication",(function(){return je})),r.d(e,"Management",(function(){return Ee})),r.d(e,"WebAuth",(function(){return Ae})),r.d(e,"version",(function(){return ot}));var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var s=o((function(t){var e,r;e=i,r=function(){return function(){return function(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n0&&(i=i.replace(/^[\/]+/,"")),i=n0?"?":"")+s.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=r():e.urljoin=r()})),a=Object.prototype.hasOwnProperty,u=Array.isArray,c=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),p=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n1;){var e=t.pop(),r=e.obj[e.prop];if(u(r)){for(var n=[],i=0;i=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122?i+=n.charAt(o):s<128?i+=c[s]:s<2048?i+=c[192|s>>6]+c[128|63&s]:s<55296||s>=57344?i+=c[224|s>>12]+c[128|s>>6&63]+c[128|63&s]:(o+=1,s=65536+((1023&s)<<10|1023&n.charCodeAt(o)),i+=c[240|s>>18]+c[128|s>>12&63]+c[128|s>>6&63]+c[128|63&s])}return i},isBuffer:function(t){return!(!t||"object"!=typeof t||!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t)))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(u(t)){for(var r=[],n=0;n-1?t.split(","):t},j=function(t,e,r,n){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(i),a=s?i.slice(0,s.index):i,u=[];if(a){if(!r.plainObjects&&S.call(Object.prototype,a)&&!r.allowPrototypes)return;u.push(a)}for(var c=0;r.depth>0&&null!==(s=o.exec(i))&&c=0;--o){var s,a=t[o];if("[]"===a&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var u="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(u,10);r.parseArrays||""!==u?!isNaN(c)&&a!==u&&String(c)===u&&c>=0&&r.parseArrays&&c<=r.arrayLimit?(s=[])[c]=i:s[u]=i:s={0:i}}i=s}return i}(u,e,r,n)}},E=function(t,e){var r,n=t,i=function(t){if(!t)return O;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||O.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=y.default;if(void 0!==t.format){if(!m.call(y.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=y.formatters[r],i=O.filter;return("function"==typeof t.filter||v(t.filter))&&(i=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:O.addQueryPrefix,allowDots:void 0===t.allowDots?O.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:O.charsetSentinel,delimiter:void 0===t.delimiter?O.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:O.encode,encoder:"function"==typeof t.encoder?t.encoder:O.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:O.encodeValuesOnly,filter:i,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:O.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:O.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:O.strictNullHandling}}(e);"function"==typeof i.filter?n=(0,i.filter)("",n):v(i.filter)&&(r=i.filter);var o,s=[];if("object"!=typeof n||null===n)return"";o=e&&e.arrayFormat in g?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var a=g[o];r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var u=0;u0?h+p:""},q=o((function(t){function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;ie?1:0}function L(t,e,r){var n,i=function t(e,r,n,i){var o;if("object"==typeof e&&null!==e){for(o=0;o0)for(var n=0;n=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!==e.status)return!0;if(t){if(t.code&&F.includes(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},V.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},V.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){n.on("abort",(function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)e(r.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}})),n.end((function(r,n){r?e(r):t(n)}))}))}return this._fullfilledPromise.then(t,e)},V.prototype.catch=function(t){return this.then(void 0,t)},V.prototype.use=function(t){return t(this),this},V.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},V.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},V.prototype.get=function(t){return this._header[t.toLowerCase()]},V.prototype.getHeader=V.prototype.get,V.prototype.set=function(t,e){if(H(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},V.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},V.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(H(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(r,t[r]);return this}if(Array.isArray(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(t,e[n]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},V.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},V.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},V.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},V.prototype.redirects=function(t){return this._maxRedirects=t,this},V.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},V.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},V.prototype.send=function(t){var e=H(t),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&H(this._data))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this._data[n]=t[n]);else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||r||this.type("json"),this},V.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},V.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.slice(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,e)+"?"+r.join("&")}}},V.prototype._appendQueryString=function(){console.warn("Unsupported")},V.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error("".concat(t+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},V.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))};var J=$;function $(t){if(t)return function(t){for(var e in $.prototype)Object.prototype.hasOwnProperty.call($.prototype,e)&&(t[e]=$.prototype[e]);return t}(t)}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0||t instanceof Object)?e(t):null)},h.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),i=new Error(n);return i.status=this.status,i.method=e,i.url=r,i},o.Response=h,q(l.prototype),z(l.prototype),l.prototype.type=function(t){return this.set("Content-Type",o.types[t]||t),this},l.prototype.accept=function(t){return this.set("Accept",o.types[t]||t),this},l.prototype.auth=function(t,e,n){return 1===arguments.length&&(e=""),"object"===r(e)&&null!==e&&(n=e,e=""),n||(n={type:"function"==typeof btoa?"basic":"auto"}),this._auth(t,e,n,(function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")}))},l.prototype.query=function(t){return"string"!=typeof t&&(t=a(t)),t&&this._query.push(t),this},l.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},l.prototype._getFormData=function(){return this._formData||(this._formData=new n.FormData),this._formData},l.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},l.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},l.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},l.prototype.ca=l.prototype.agent,l.prototype.buffer=l.prototype.ca,l.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},l.prototype.pipe=l.prototype.write,l.prototype._isHost=function(t){return t&&"object"===r(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},l.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||i,this._finalizeQueryString(),this._end()},l.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},l.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=o.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",n.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",n.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var i=this._header["content-type"],s=this._serializer||o.serialize[i?i.split(";")[0]:""];!s&&p(i)&&(s=o.serialize["application/json"]),s&&(r=s(r))}for(var a in this.header)null!==this.header[a]&&Object.prototype.hasOwnProperty.call(this.header,a)&&e.setRequestHeader(a,this.header[a]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},o.agent=function(){return new Q},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){Q.prototype[t.toLowerCase()]=function(e,r){var n=new o.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}})),Q.prototype.del=Q.prototype.delete,o.get=function(t,e,r){var n=o("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},o.head=function(t,e,r){var n=o("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},o.options=function(t,e,r){var n=o("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},o.del=f,o.delete=f,o.patch=function(t,e,r){var n=o("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},o.post=function(t,e,r){var n=o("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},o.put=function(t,e,r){var n=o("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}})),G=(K.Request,[]),Y=[],tt=("undefined"!=typeof Uint8Array&&Uint8Array,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),et=0,rt=tt.length;et>18&63]+G[i>>12&63]+G[i>>6&63]+G[63&i]);return o.join("")}Y["-".charCodeAt(0)]=62,Y["_".charCodeAt(0)]=63;var it=function(t){return function(t){for(var e,r=t.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));return 1===n?(e=t[r-1],i.push(G[e>>2]+G[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],i.push(G[e>>10]+G[e>>4&63]+G[e<<2&63]+"=")),i.join("")}(function(t){for(var e=new Array(t.length),r=0;r=65&&e<=90||!i&&e>=48&&e<=57?(r+="_",r+=t[n].toLowerCase()):r+=t[n].toLowerCase(),i=e>=48&&e<=57,o=e>=65&&e<=90,n++;return r}(i):i]=t(e[i]),n}),{}))},toCamelCase:function t(e,r,n){return"object"!=typeof e||pt.isArray(e)||null===e?e:(r=r||[],n=n||{},Object.keys(e).reduce((function(i,o){var s,a=-1===r.indexOf(o)?(s=o.split("_")).reduce((function(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)}),s.shift()):o;return i[a]=t(e[a]||e[o],[],n),n.keepOriginal&&(i[o]=t(e[o],[],n)),i}),{}))},blacklist:function(t,e){return Object.keys(t).reduce((function(r,n){return-1===e.indexOf(n)&&(r[n]=t[n]),r}),{})},merge:function(t,e){return{base:e?ft(t,e):t,with:function(t,e){return t=e?ft(t,e):t,dt(this.base,t)}}},pick:ft,getKeysNotIn:function(t,e){var r=[];for(var n in t)-1===e.indexOf(n)&&r.push(n);return r},extend:dt,getOriginFromUrl:function(t){if(t){var e=yt(t);if(!e)return null;var r=e.protocol+"//"+e.hostname;return e.port&&(r+=":"+e.port),r}},getLocationFromUrl:yt,trimUserDetails:function(t){return function(t,e){return["username","email","phoneNumber"].reduce(mt,t)}(t)},updatePropertyOn:function t(e,r,n){"string"==typeof r&&(r=r.split("."));var i=r[0];e.hasOwnProperty(i)&&(1===r.length?e[i]=n:t(e[i],r.slice(1),n))}};function vt(t){this.request=t,this.method=t.method,this.url=t.url,this.body=t._data,this.headers=t._header}function bt(t){this.request=t}function wt(t){this._sendTelemetry=!1!==t._sendTelemetry||t._sendTelemetry,this._telemetryInfo=t._telemetryInfo||null,this._timesToRetryFailedRequests=t._timesToRetryFailedRequests,this.headers=t.headers||{},this._universalLoginPage=t.universalLoginPage}function _t(){return window}vt.prototype.abort=function(){this.request.abort()},vt.prototype.getMethod=function(){return this.method},vt.prototype.getBody=function(){return this.body},vt.prototype.getUrl=function(){return this.url},vt.prototype.getHeaders=function(){return this.headers},bt.prototype.set=function(t,e){return this.request=this.request.set(t,e),this},bt.prototype.send=function(t){return this.request=this.request.send(gt.trimUserDetails(t)),this},bt.prototype.withCredentials=function(){return this.request=this.request.withCredentials(),this},bt.prototype.end=function(t){return this.request.end(t),new vt(this.request)},wt.prototype.setCommonConfiguration=function(t,e){if(e=e||{},this._timesToRetryFailedRequests>0&&(t=t.retry(this._timesToRetryFailedRequests)),e.noHeaders)return t;var r=this.headers;t=t.set("Content-Type","application/json");for(var n=Object.keys(this.headers),i=0;i>>2]|=(r[o>>>2]>>>24-o%4*8&255)<<24-(n+o)%4*8;else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var r,n=[],i=function(e){var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(r,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255));return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(r,e)}},p=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},h=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,a=i/(4*o),u=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*o,c=t.min(4*u,i);if(u){for(var p=0;p>>7)^(d<<14|d>>>18)^d>>>3)+c[f-7]+((y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10)+c[f-16]}var m=n&i^n&o^i&o,g=l+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&p^~a&h)+u[f]+c[f];l=h,h=p,p=a,a=s+g|0,s=o,o=i,i=n,n=g+(((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+m)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+p|0,r[6]=r[6]+h|0,r[7]=r[7]+l|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(p),e.HmacSHA256=o._createHmacHelper(p)}(Math),r.SHA256)})),Nt=Mt((function(t,e){var r,n;t.exports=(r=(n=Lt).lib.WordArray,n.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(t){var e=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>6-s%4*2;i[o>>>2]|=(a|u)<<24-o%4*8,o++}return r.create(i,o)}(t,e,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},n.enc.Base64)})),Ht=Mt((function(t,e){t.exports=Lt.enc.Hex})),Wt=Mt((function(t,e){(function(){var e;function r(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):this.fromString(t,null==e&&"string"!=typeof t?256:e))}function n(){return new r(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(var s=32767&e,a=e>>15;--o>=0;){var u=32767&this[t],c=this[t++]>>15,p=a*u+c*s;i=((u=s*u+((32767&p)<<15)+r[n]+(1073741823&i))>>>30)+(p>>>15)+a*c+(i>>>30),r[n++]=1073741823&u}return i},e=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var s=e*this[t++]+r[n]+i;i=Math.floor(s/67108864),r[n++]=67108863&s}return i},e=26):(r.prototype.am=function(t,e,r,n,i,o){for(var s=16383&e,a=e>>14;--o>=0;){var u=16383&this[t],c=this[t++]>>14,p=a*u+c*s;i=((u=s*u+((16383&p)<<14)+r[n]+i)>>28)+(p>>14)+a*c,r[n++]=268435455&u}return i},e=28),r.prototype.DB=e,r.prototype.DM=(1<>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function l(t){this.m=t}function f(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function b(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function w(){}function _(t){return t}function T(t){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}l.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},l.prototype.revert=function(t){return t},l.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},l.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},l.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},f.prototype.convert=function(t){var e=n();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e},f.prototype.revert=function(t){var e=n();return t.copyTo(e),this.reduce(e),e},f.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},f.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},f.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var i=t.length,o=!1,s=0;--i>=0;){var a=8==n?255&t[i]:c(t,i);a<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<>this.DB-s):this[this.t-1]|=a<=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var r=t;r=0;--r)e[r+s+1]=this[r]>>i|a,a=(this[r]&o)<=0;--r)e[r]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<>n;for(var s=r+1;s>n;n>0&&(e[this.t-r-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),i=t.abs(),o=n.t;for(e.t=o+i.t;--o>=0;)e[o]=0;for(o=0;o=0;)t[r]=0;for(r=0;r=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,i){var o=t.abs();if(!(o.t<=0)){var s=this.abs();if(s.t0?(o.lShiftTo(p,a),s.lShiftTo(p,i)):(o.copyTo(a),s.copyTo(i));var l=a.t,f=a[l-1];if(0!=f){var d=f*(1<1?a[l-2]>>this.F2:0),y=this.FV/d,m=(1<=0&&(i[i.t++]=1,i.subTo(w,i)),r.ONE.dlShiftTo(l,w),w.subTo(a,a);a.t=0;){var _=i[--v]==f?this.DM:Math.floor(i[v]*y+(i[v-1]+g)*m);if((i[v]+=a.am(0,_,i,b,0,l))<_)for(a.dlShiftTo(b,w),i.subTo(w,i);i[v]<--_;)i.subTo(w,i)}null!=e&&(i.drShiftTo(l,e),u!=c&&r.ZERO.subTo(e,e)),i.t=l,i.clamp(),p>0&&i.rShiftTo(p,i),u<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var i=n(),o=n(),s=e.convert(this),a=h(t)-1;for(s.copyTo(i);--a>=0;)if(e.sqrTo(i,o),(t&1<0)e.mulTo(o,s,i);else{var u=i;i=o,o=u}return e.revert(i)},r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<0)for(a>a)>0&&(i=!0,o=u(r));s>=0;)a>(a+=this.DB-e)):(r=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),r>0&&(i=!0),i&&(o+=u(r));return i?o:"0"},r.prototype.negate=function(){var t=n();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+h(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=n();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new l(e):new f(e),this.exp(t,r)},r.ZERO=p(0),r.ONE=p(1),w.prototype.convert=_,w.prototype.revert=_,w.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},w.prototype.sqrTo=function(t,e){t.squareTo(e)},T.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=n();return t.copyTo(e),this.reduce(e),e},T.prototype.revert=function(t){return t},T.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var O,k,S,C=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],A=(1<<26)/C[C.length-1];function D(){var t;t=(new Date).getTime(),k[S++]^=255&t,k[S++]^=t>>8&255,k[S++]^=t>>16&255,k[S++]^=t>>24&255,S>=R&&(S-=R)}if(r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),i=p(r),o=n(),s=n(),a="";for(this.divRemTo(i,o,s);o.signum()>0;)a=(r+s.intValue()).toString(t).substr(1)+a,o.divRemTo(i,o,s);return s.intValue().toString(t)+a},r.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),i=Math.pow(e,n),o=!1,s=0,a=0,u=0;u=n&&(this.dMultiply(i),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),o&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var i=new Array,o=7&t;i.length=1+(t>>3),e.nextBytes(i),o>0?i[0]&=(1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(n=r.t-this.t;i=0;)r[n]=0;for(n=Math.max(e-this.t,0);n0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var o=e.shiftRight(i);(t=t+1>>1)>C.length&&(t=C.length);for(var s=n(),a=0;a>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<=0;)n<8?(r=(this[t]&(1<>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},r.prototype.equals=function(t){return 0==this.compareTo(t)},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=n();return this.bitwiseTo(t,d,e),e},r.prototype.or=function(t){var e=n();return this.bitwiseTo(t,y,e),e},r.prototype.xor=function(t){var e=n();return this.bitwiseTo(t,m,e),e},r.prototype.andNot=function(t){var e=n();return this.bitwiseTo(t,g,e),e},r.prototype.not=function(){for(var t=n(),e=0;e=this.t?0!=this.s:0!=(this[e]&1<1){var y=n();for(i.sqrTo(a[1],y);u<=d;)a[u]=n(),i.mulTo(y,a[u-2],a[u]),u+=2}var m,g,v=t.t-1,b=!0,w=n();for(o=h(t[v])-1;v>=0;){for(o>=c?m=t[v]>>o-c&d:(m=(t[v]&(1<0&&(m|=t[v-1]>>this.DB+o-c)),u=r;0==(1&m);)m>>=1,--u;if((o-=u)<0&&(o+=this.DB,--v),b)a[m].copyTo(s),b=!1;else{for(;u>1;)i.sqrTo(s,w),i.sqrTo(w,s),u-=2;u>0?i.sqrTo(s,w):(g=s,s=w,w=g),i.mulTo(w,a[m],s)}for(;v>=0&&0==(t[v]&1<=0?(n.subTo(i,n),e&&o.subTo(a,o),s.subTo(u,s)):(i.subTo(n,i),e&&a.subTo(o,a),u.subTo(s,u))}return 0!=i.compareTo(r.ONE)?r.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},r.prototype.pow=function(t){return this.exp(t,new w)},r.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},r.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=C[C.length-1]){for(e=0;e>>8,k[S++]=255&x;S=0,D()}function q(){if(null==O){for(D(),(O=new U).init(k),S=0;S0&&e.length>0))throw new Error("Invalid key data");this.n=new Wt.BigInteger(t,16),this.e=parseInt(e,16)}Ft.prototype.verify=function(t,e){e=e.replace(/[^0-9a-f]|[\s\n]]/gi,"");var r=new Wt.BigInteger(e,16);if(r.bitLength()>this.n.bitLength())throw new Error("Signature does not match with the key modulus.");var n=function(t){for(var e in zt){var r=zt[e],n=r.length;if(t.substring(0,n)===r)return{alg:e,hash:t.substring(n)}}return[]}(r.modPowInt(this.e,this.n).toString(16).replace(/^1f+00/,""));if(0===n.length)return!1;if(!Vt.hasOwnProperty(n.alg))throw new Error("Hashing algorithm is not supported.");var i=Vt[n.alg](t).toString();return n.hash===i};for(var Jt=[],$t=[],Xt="undefined"!=typeof Uint8Array?Uint8Array:Array,Zt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Qt=0,Kt=Zt.length;Qt0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}(t),i=n[0],o=n[1],s=new Xt(3*(i+o)/4-o),a=0,u=o>0?i-4:i;for(r=0;r>16&255,s[a++]=e>>8&255,s[a++]=255&e;return 2===o&&(e=$t[t.charCodeAt(r)]<<2|$t[t.charCodeAt(r+1)]>>4,s[a++]=255&e),1===o&&(e=$t[t.charCodeAt(r)]<<10|$t[t.charCodeAt(r+1)]<<4|$t[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s};function Yt(t){var e=t.length%4;return 0===e?t:t+new Array(4-e+1).join("=")}function te(t){return t=Yt(t).replace(/\-/g,"+").replace(/_/g,"/"),decodeURIComponent(function(t){for(var e="",r=0;r1){var r=t.shift();t[0]=r+t[0]}t[0]=t[0].match(/^file:\/\/\//)?t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n0&&(i=i.replace(/^[\/]+/,"")),i=i.replace(/[\/]+$/,n0?"?":"")+s.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=r():e.urljoin=r()}));function ne(t){if(t.ok)return t.json();var e=new Error(t.statusText);return e.response=t,Promise.reject(e)}function ie(t){this.name="ConfigurationError",this.message=t||""}function oe(t){this.name="TokenValidationError",this.message=t||""}ie.prototype=Error.prototype,oe.prototype=Error.prototype;var se=function(){function t(){}var e=t.prototype;return e.get=function(){return null},e.has=function(){return null},e.set=function(){return null},t}();Pt.polyfill();var ae=function(t){return"number"==typeof t},ue=function(){return new Date};function ce(t){var e=t||{};if(this.jwksCache=e.jwksCache||new se,this.expectedAlg=e.expectedAlg||"RS256",this.issuer=e.issuer,this.audience=e.audience,this.leeway=0===e.leeway?0:e.leeway||60,this.jwksURI=e.jwksURI,this.maxAge=e.maxAge,this.__clock="function"==typeof e.__clock?e.__clock:ue,this.leeway<0||this.leeway>300)throw new ie("The leeway should be positive and lower than five minutes.");if("RS256"!==this.expectedAlg)throw new ie('Signature algorithm of "'+this.expectedAlg+'" is not supported. Expected the ID token to be signed with "RS256".')}function pe(t,e){this.plugins=e;for(var r=0;r1){if(!d||"string"!=typeof d)return r(new oe("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values",!1));if(d!==v.audience)return r(new oe('Authorized Party (azp) claim mismatch in the ID token; expected "'+v.audience+'", found "'+d+'"',!1))}if(!h||!ae(h))return r(new oe("Expiration Time (exp) claim must be a number present in the ID token",!1));if(!f||!ae(f))return r(new oe("Issued At (iat) claim must be a number present in the ID token"));var a=h+v.leeway,b=new Date(0);if(b.setUTCSeconds(a),g>b)return r(new oe('Expiration Time (exp) claim error in the ID token; current time "'+g+'" is after expiration time "'+b+'"',!1));if(l&&ae(l)){var w=l-v.leeway,_=new Date(0);if(_.setUTCSeconds(w),g<_)return r(new oe('Not Before Time (nbf) claim error in the ID token; current time "'+g+'" is before the not before time "'+_+'"'))}if(v.maxAge){if(!y||!ae(y))return r(new oe("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified"));var T=y+v.maxAge+v.leeway,O=new Date(0);if(O.setUTCSeconds(T),g>O)return r(new oe('Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time "'+g+'" is after last auth time at "'+O+'"'))}return r(null,n.payload)}))},ce.prototype.getRsaVerifier=function(t,e,r){var n=this,i=t+e;Promise.resolve(this.jwksCache.has(i)).then((function(r){return r?n.jwksCache.get(i):(o={jwksURI:n.jwksURI,iss:t,kid:e},("undefined"==typeof fetch?function(t,e){return e=e||{},new Promise((function(r,n){var i=new XMLHttpRequest,o=[],s=[],a={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(JSON.parse(i.responseText))},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return s},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase()in a}}}};for(var c in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,r){o.push(e=e.toLowerCase()),s.push([e,r]),a[e]=a[e]?a[e]+","+r:r})),r(u())},i.onerror=n,i.withCredentials="include"==e.credentials,e.headers)i.setRequestHeader(c,e.headers[c]);i.send(e.body||null)}))}:fetch)(o.jwksURI||re(o.iss,".well-known","jwks.json")).then(ne).then((function(t){var e,r,n,i=null;for(e=0;e-1&&null!==new RegExp("rv:([0-9]{2,2}[.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1)),t>=8}();return"undefined"!=typeof window&&window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage?{open:function(i,o){if(!o)throw"missing required callback argument";var s,a;i.url||(s="missing required 'url' parameter"),i.relay_url||(s="missing required 'relay_url' parameter"),s&&setTimeout((function(){o(s)}),0),i.window_name||(i.window_name=null),i.window_features&&!function(){try{var t=navigator.userAgent;return-1!=t.indexOf("Fennec/")||-1!=t.indexOf("Firefox/")&&-1!=t.indexOf("Android")}catch(t){}return!1}()||(i.window_features=void 0);var u,c=i.origin||r(i.url);if(c!==r(i.relay_url))return setTimeout((function(){o("invalid arguments: origin of url and relay_url must match")}),0);n&&((a=document.createElement("iframe")).setAttribute("src",i.relay_url),a.style.display="none",a.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(a),u=a.contentWindow);var p=i.popup||window.open(i.url,i.window_name,i.window_features);i.popup&&(p.location.href=i.url),u||(u=p);var h=setInterval((function(){p&&p.closed&&(f(),o&&(o("User closed the popup window"),o=null))}),500),l=JSON.stringify({a:"request",d:i.params});function f(){if(a&&document.body.removeChild(a),a=void 0,h&&(h=clearInterval(h)),e(window,"message",d),e(window,"unload",f),p)try{p.close()}catch(t){u.postMessage("die",c)}p=u=void 0}function d(t){if(t.origin===c){try{var e=JSON.parse(t.data)}catch(t){if(o)return o(t);throw t}"ready"===e.a?u.postMessage(l,c):"error"===e.a?(f(),o&&(o(e.d),o=null)):"response"===e.a&&(f(),o&&(o(null,e.d),o=null))}}return t(window,"unload",f),t(window,"message",d),{originalPopup:p,close:f,focus:function(){if(p)try{p.focus()}catch(t){}}}},onOpen:function(r){var i="*",o=n?function(){for(var t=window.opener.frames,e=t.length-1;e>=0;e--)try{if(t[e].location.protocol===window.location.protocol&&t[e].location.host===window.location.host&&"__winchan_relay_frame"===t[e].name)return t[e]}catch(t){}}():window.opener;if(!o)throw"can't find relay frame";function s(t){t=JSON.stringify(t),n?o.doPost(t,i):o.postMessage(t,i)}function a(t){if("die"===t.data)try{window.close()}catch(t){}}t(n?o:window,"message",(function t(n){var o;try{o=JSON.parse(n.data)}catch(t){}o&&"request"===o.a&&(e(window,"message",t),i=n.origin,r&&setTimeout((function(){r(i,o.d,(function(t){r=void 0,s({a:"response",d:t})}))}),0))})),t(n?o:window,"message",a);try{s({a:"ready"})}catch(e){t(o,"load",(function(t){s({a:"ready"})}))}var u=function(){try{e(n?o:window,"message",a)}catch(t){}r&&s({a:"error",d:"client closed window"}),r=void 0;try{window.close()}catch(t){}};return t(window,"unload",u),{detach:function(){e(window,"unload",u)}}}}:{open:function(t,e,r,n){setTimeout((function(){n("unsupported browser")}),0)},onOpen:function(t){setTimeout((function(){t("unsupported browser")}),0)}}}();t.exports&&(t.exports=e)}));function be(){this._current_popup=null}function we(t,e){this.baseOptions=e,this.baseOptions.popupOrigin=e.popupOrigin,this.client=t.client,this.webAuth=t,this.transactionManager=new le(this.baseOptions),this.crossOriginAuthentication=new ye(t,this.baseOptions),this.warn=new Ct({disableWarnings:!!e._disableDeprecationWarnings})}function _e(t){this.authenticationUrl=t.authenticationUrl,this.timeout=t.timeout||6e4,this.handler=null,this.postMessageDataType=t.postMessageDataType||!1,this.postMessageOrigin=t.postMessageOrigin||Tt.getWindow().location.origin||Tt.getWindow().location.protocol+"//"+Tt.getWindow().location.hostname+(Tt.getWindow().location.port?":"+Tt.getWindow().location.port:"")}function Te(t){this.baseOptions=t,this.request=new wt(t),this.transactionManager=new le(this.baseOptions)}function Oe(t,e){this.baseOptions=e,this.client=t,this.baseOptions.universalLoginPage=!0,this.request=new wt(this.baseOptions),this.warn=new Ct({disableWarnings:!!e._disableDeprecationWarnings})}be.prototype.calculatePosition=function(t){var e=t.width||500,r=t.height||600,n=Tt.getWindow(),i=void 0!==n.screenX?n.screenX:n.screenLeft,o=void 0!==n.screenY?n.screenY:n.screenTop,s=void 0!==n.outerWidth?n.outerWidth:n.document.body.clientWidth,a=void 0!==n.outerHeight?n.outerHeight:n.document.body.clientHeight;return{width:e,height:r,left:t.left||i+(s-e)/2,top:t.top||o+(a-r)/2}},be.prototype.preload=function(t){var e=this,r=Tt.getWindow(),n=this.calculatePosition(t.popupOptions||{}),i=gt.merge(n).with(t.popupOptions),o=t.url||"about:blank",s=E(i,{encode:!1,delimiter:","});return this._current_popup&&!this._current_popup.closed||(this._current_popup=r.open(o,"auth0_signup_popup",s),this._current_popup.kill=function(){this.close(),e._current_popup=null}),this._current_popup},be.prototype.load=function(t,e,r,n){var i=this,o=this.calculatePosition(r.popupOptions||{}),s=gt.merge(o).with(r.popupOptions),a=gt.merge({url:t,relay_url:e,window_features:E(s,{delimiter:",",encode:!1}),popup:this._current_popup}).with(r),u=ve.open(a,(function(t,e){if(!t||"SyntaxError"!==t.name)return i._current_popup=null,n(t,e)}));return u.focus(),u},we.prototype.buildPopupHandler=function(){var t=this.baseOptions.plugins.get("popup.getPopupHandler");return t?t.getPopupHandler():new be},we.prototype.preload=function(t){t=t||{};var e=this.buildPopupHandler();return e.preload(t),e},we.prototype.getPopupHandler=function(t,e){return t.popupHandler?t.popupHandler:e?this.preload(t):this.buildPopupHandler()},we.prototype.callback=function(t){var e=this,r=Tt.getWindow(),n=(t=t||{}).popupOrigin||this.baseOptions.popupOrigin||Tt.getOrigin();r.opener?ve.onOpen((function(r,i,o){if(r!==n)return o({error:"origin_mismatch",error_description:"The popup's origin ("+r+") should match the `popupOrigin` parameter ("+n+")."});e.webAuth.parseHash(t||{},(function(t,e){return o(t||e)}))})):r.doPost=function(t){r.parent&&r.parent.postMessage(t,n)}},we.prototype.authorize=function(t,e){var r,n,i={},o=this.baseOptions.plugins.get("popup.authorize"),a=gt.merge(this.baseOptions,["clientID","scope","domain","audience","tenant","responseType","redirectUri","_csrf","state","_intstate","nonce"]).with(gt.blacklist(t,["popupHandler"]));return pt.check(a,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),n=s(this.baseOptions.rootUrl,"relay.html"),t.owp?a.owp=!0:(i.origin=function(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[-_a-zA-Z.0-9:]+)/.exec(t);return e?e[1]:t}(a.redirectUri),n=a.redirectUri),t.popupOptions&&(i.popupOptions=gt.pick(t.popupOptions,["width","height","top","left"])),o&&(a=o.processParams(a)),(a=this.transactionManager.process(a)).scope=a.scope||"openid profile email",delete a.domain,r=this.client.buildAuthorizeUrl(a),this.getPopupHandler(t).load(r,n,i,qt(e,{keepOriginalCasing:!0}))},we.prototype.loginWithCredentials=function(t,e){t.realm=t.realm||t.connection,t.popup=!0,t=gt.merge(this.baseOptions,["redirectUri","responseType","state","nonce"]).with(gt.blacklist(t,["popupHandler","connection"])),t=this.transactionManager.process(t),this.crossOriginAuthentication.login(t,e)},we.prototype.passwordlessVerify=function(t,e){var r=this;return this.client.passwordless.verify(gt.blacklist(t,["popupHandler"]),(function(n){if(n)return e(n);t.username=t.phoneNumber||t.email,t.password=t.verificationCode,delete t.email,delete t.phoneNumber,delete t.verificationCode,delete t.type,r.client.loginWithResourceOwner(t,e)}))},we.prototype.signupAndLogin=function(t,e){var r=this;return this.client.dbConnection.signup(t,(function(n){if(n)return e(n);r.loginWithCredentials(t,e)}))},_e.create=function(t){return new _e(t)},_e.prototype.login=function(t,e){this.handler=new fe({auth0:this.auth0,url:this.authenticationUrl,eventListenerType:t?"message":"load",callback:this.getCallbackHandler(e,t),timeout:this.timeout,eventValidator:this.getEventValidator(),timeoutCallback:function(){e(null,"#error=timeout&error_description=Timeout+during+authentication+renew.")},usePostMessage:t||!1}),this.handler.init()},_e.prototype.getEventValidator=function(){var t=this;return{isValid:function(e){switch(e.event.type){case"message":return e.event.origin===t.postMessageOrigin&&e.event.source===t.handler.iframe.contentWindow&&(!1===t.postMessageDataType||e.event.data.type&&e.event.data.type===t.postMessageDataType);case"load":if("about:"===e.sourceObject.contentWindow.location.protocol)return!1;default:return!0}}}},_e.prototype.getCallbackHandler=function(t,e){return function(r){var n;n=e?"object"==typeof r.event.data&&r.event.data.hash?r.event.data.hash:r.event.data:r.sourceObject.contentWindow.location.hash,t(null,n)}},Te.prototype.login=function(t,e){var r,n;return r=s(this.baseOptions.rootUrl,"usernamepassword","login"),t.username=t.username||t.email,t=gt.blacklist(t,["email"]),n=gt.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience"]).with(t),n=this.transactionManager.process(n),n=gt.toSnakeCase(n,["auth0Client"]),this.request.post(r).send(n).end(qt(e))},Te.prototype.callback=function(t){var e,r=Tt.getDocument();(e=r.createElement("div")).innerHTML=t,r.body.appendChild(e).children[0].submit()},Oe.prototype.login=function(t,e){if(Tt.getWindow().location.host!==this.baseOptions.domain)throw new Error("This method is meant to be used only inside the Universal Login Page.");var r,n=gt.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return pt.check(n,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(r=new Te(this.baseOptions)).login(n,(function(t,n){return t?e(t):r.callback(n)}))},Oe.prototype.signupAndLogin=function(t,e){var r=this;return r.client.client.dbConnection.signup(t,(function(n){return n?e(n):r.login(t,e)}))},Oe.prototype.getSSOData=function(t,e){var r,n="";return"function"==typeof t&&(e=t,t=!1),pt.check(t,{type:"boolean",message:"withActiveDirectories parameter is not valid"}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),t&&(n="?"+E({ldaps:1,client_id:this.baseOptions.clientID})),r=s(this.baseOptions.rootUrl,"user","ssodata",n),this.request.get(r,{noHeaders:!0}).withCredentials().end(qt(e))};var ke=function(){},Se={lang:"en",templates:{auth0:function(t){var e="code"===t.type?"Enter the code shown above":"Solve the formula shown above";return'
\n \n \n
\n'},recaptcha_v2:function(){return'
'},error:function(){return'
Error getting the bot detection challenge. Please contact the system administrator.
'}}};function Ce(){return new Date}function Ae(t){pt.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},popupOrigin:{optional:!0,type:"string",message:"popupOrigin is not valid"},leeway:{optional:!0,type:"number",message:"leeway is not valid"},plugins:{optional:!0,type:"array",message:"plugins is not valid"},maxAge:{optional:!0,type:"number",message:"maxAge is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"},_timesToRetryFailedRequests:{optional:!0,type:"number",message:"_timesToRetryFailedRequests option is not valid"}}),t.overrides&&pt.check(t.overrides,{type:"object",message:"overrides option is not valid"},{__tenant:{optional:!0,type:"string",message:"__tenant option is required"},__token_issuer:{optional:!0,type:"string",message:"__token_issuer option is required"},__jwks_uri:{optional:!0,type:"string",message:"__jwks_uri is required"}}),this.baseOptions=t,this.baseOptions.plugins=new pe(this,this.baseOptions.plugins||[]),this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions._timesToRetryFailedRequests=t._timesToRetryFailedRequests?parseInt(t._timesToRetryFailedRequests,0):0,this.baseOptions.tenant=this.baseOptions.overrides&&this.baseOptions.overrides.__tenant||this.baseOptions.domain.split(".")[0],this.baseOptions.token_issuer=this.baseOptions.overrides&&this.baseOptions.overrides.__token_issuer||"https://"+this.baseOptions.domain+"/",this.baseOptions.jwksURI=this.baseOptions.overrides&&this.baseOptions.overrides.__jwks_uri,this.transactionManager=new le(this.baseOptions),this.client=new je(this.baseOptions),this.redirect=new ge(this,this.baseOptions),this.popup=new we(this,this.baseOptions),this.crossOriginAuthentication=new ye(this,this.baseOptions),this.webMessageHandler=new de(this),this._universalLogin=new Oe(this,this.baseOptions),this.ssodataStorage=new xt(this.baseOptions)}function De(t,e){this.baseOptions=e,this.request=t}function xe(t,e){this.baseOptions=e,this.request=t}function je(t,e){2===arguments.length?this.auth0=t:e=t,pt.check(e,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=e,this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions.rootUrl="https://"+this.baseOptions.domain,this.request=new wt(this.baseOptions),this.passwordless=new De(this.request,this.baseOptions),this.dbConnection=new xe(this.request,this.baseOptions),this.warn=new Ct({disableWarnings:!!e._disableDeprecationWarnings}),this.ssodataStorage=new xt(this.baseOptions)}function Ee(t){pt.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},token:{type:"string",message:"token option is required"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=t,this.baseOptions.headers={Authorization:"Bearer "+this.baseOptions.token},this.request=new wt(this.baseOptions),this.baseOptions.rootUrl=s("https://"+this.baseOptions.domain,"api","v2")}Ae.prototype.parseHash=function(t,e){var r,n;e||"function"!=typeof t?t=t||{}:(e=t,t={});var i=Tt.getWindow(),o=void 0===t.hash?i.location.hash:t.hash;if((r=function(t,e){var r=A;if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},i=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,o=e.parameterLimit===1/0?void 0:e.parameterLimit,s=i.split(e.delimiter,o),a=-1,u=e.charset;if(e.charsetSentinel)for(r=0;r-1&&(p=C(p)?[p]:p),S.call(n,c)?n[c]=h.combine(n[c],p):n[c]=p}return n}(t,r):t,i=r.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s0&&-1!==s.indexOf("token")&&!r.hasOwnProperty("access_token")?e(Et.buildResponse("invalid_hash","response_type contains `token`, but the parsed hash does not contain an `access_token` property")):s.length>0&&-1!==s.indexOf("id_token")&&!r.hasOwnProperty("id_token")?e(Et.buildResponse("invalid_hash","response_type contains `id_token`, but the parsed hash does not contain an `id_token` property")):this.validateAuthenticationResponse(t,r,e)},Ae.prototype.validateAuthenticationResponse=function(t,e,r){var n=this;t.__enableIdPInitiatedLogin=t.__enableIdPInitiatedLogin||t.__enableImpersonation;var i=e.state,o=this.transactionManager.getStoredTransaction(i),s=t.state||o&&o.state||null,a=s===i;if((i||s||!t.__enableIdPInitiatedLogin)&&!a)return r({error:"invalid_token",errorDescription:"`state` does not match."});var u=t.nonce||o&&o.nonce||null,c=t.state||o&&o.appState||null,p=function(t,i){return t?r(t):(o&&o.lastUsedConnection&&(i&&(s=i.sub),n.ssodataStorage.set(o.lastUsedConnection,s)),r(null,function(t,e,r){return{accessToken:t.access_token||null,idToken:t.id_token||null,idTokenPayload:r||null,appState:e||null,refreshToken:t.refresh_token||null,state:t.state||null,expiresIn:t.expires_in?parseInt(t.expires_in,10):null,tokenType:t.token_type||null,scope:t.scope||null}}(e,c,i)));var s};return e.id_token?this.validateToken(e.id_token,u,(function(t,r){if(!t)return e.access_token&&r.at_hash?(new ce).validateAccessToken(e.access_token,"RS256",r.at_hash,(function(t){return t?p(Et.invalidToken(t.message)):p(null,r)})):p(null,r);if("invalid_token"!==t.error||t.errorDescription&&t.errorDescription.indexOf("Nonce (nonce) claim value mismatch in the ID token")>-1)return p(t);var i=(new ce).decode(e.id_token);return"HS256"!==i.header.alg?p(t):(i.payload.nonce||null)!==u?p({error:"invalid_token",errorDescription:'Nonce (nonce) claim value mismatch in the ID token; expected "'+u+'", found "'+i.payload.nonce+'"'}):e.access_token?n.client.userInfo(e.access_token,(function(t,e){return t?p(t):p(null,e)})):p({error:"invalid_token",description:"The id_token cannot be validated because it was signed with the HS256 algorithm and public clients (like a browser) can\u2019t store secrets. Please read the associated doc for possible ways to fix this. Read more: https://auth0.com/docs/errors/libraries/auth0-js/invalid-token#parsing-an-hs256-signed-id-token-without-an-access-token"})})):p(null,null)},Ae.prototype.validateToken=function(t,e,r){new ce({issuer:this.baseOptions.token_issuer,jwksURI:this.baseOptions.jwksURI,audience:this.baseOptions.clientID,leeway:this.baseOptions.leeway||60,maxAge:this.baseOptions.maxAge,__clock:this.baseOptions.__clock||Ce}).verify(t,e,(function(t,e){if(t)return r(Et.invalidToken(t.message));r(null,e)}))},Ae.prototype.renewAuth=function(t,e){var r=!!t.usePostMessage,n=t.postMessageDataType||!1,i=t.postMessageOrigin||Tt.getWindow().origin,o=t.timeout,s=this,a=gt.merge(this.baseOptions,["clientID","redirectUri","responseType","scope","audience","_csrf","state","_intstate","nonce"]).with(t);a.responseType=a.responseType||"token",a.responseMode=a.responseMode||"fragment",a=this.transactionManager.process(a),pt.check(a,{type:"object",message:"options parameter is not valid"}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),a.prompt="none",a=gt.blacklist(a,["usePostMessage","tenant","postMessageDataType","postMessageOrigin"]),_e.create({authenticationUrl:this.client.buildAuthorizeUrl(a),postMessageDataType:n,postMessageOrigin:i,timeout:o}).login(r,(function(t,r){if("object"==typeof r)return e(t,r);s.parseHash({hash:r},e)}))},Ae.prototype.checkSession=function(t,e){var r=gt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return"code"===r.responseType?e({error:"error",error_description:"responseType can't be `code`"}):(t.nonce||(r=this.transactionManager.process(r)),r.redirectUri?(pt.check(r,{type:"object",message:"options parameter is not valid"}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),r=gt.blacklist(r,["usePostMessage","tenant","postMessageDataType"]),void this.webMessageHandler.run(r,qt(e,{forceLegacyError:!0,ignoreCasing:!0}))):e({error:"error",error_description:"redirectUri can't be empty"}))},Ae.prototype.changePassword=function(t,e){return this.client.dbConnection.changePassword(t,e)},Ae.prototype.passwordlessStart=function(t,e){var r=gt.merge(this.baseOptions,["responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t.authParams);return t.authParams=this.transactionManager.process(r),this.client.passwordless.start(t,e)},Ae.prototype.signup=function(t,e){return this.client.dbConnection.signup(t,e)},Ae.prototype.authorize=function(t){var e=gt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);pt.check(e,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(e=this.transactionManager.process(e)).scope=e.scope||"openid profile email",Tt.redirect(this.client.buildAuthorizeUrl(e))},Ae.prototype.signupAndAuthorize=function(t,e){var r=this;return this.client.dbConnection.signup(gt.blacklist(t,["popupHandler"]),(function(n){if(n)return e(n);t.realm=t.connection,t.username||(t.username=t.email),r.client.login(t,e)}))},Ae.prototype.login=function(t,e){var r=gt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);r=this.transactionManager.process(r),Tt.getWindow().location.host===this.baseOptions.domain?(r.connection=r.realm,delete r.realm,this._universalLogin.login(r,e)):this.crossOriginAuthentication.login(r,e)},Ae.prototype.passwordlessLogin=function(t,e){var r=gt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);if(r=this.transactionManager.process(r),Tt.getWindow().location.host===this.baseOptions.domain)this.passwordlessVerify(r,e);else{var n=gt.extend({credentialType:"http://auth0.com/oauth/grant-type/passwordless/otp",realm:r.connection,username:r.email||r.phoneNumber,otp:r.verificationCode},gt.blacklist(r,["connection","email","phoneNumber","verificationCode"]));this.crossOriginAuthentication.login(n,e)}},Ae.prototype.crossOriginAuthenticationCallback=function(){this.crossOriginVerification()},Ae.prototype.crossOriginVerification=function(){this.crossOriginAuthentication.callback()},Ae.prototype.logout=function(t){Tt.redirect(this.client.buildLogoutUrl(t))},Ae.prototype.passwordlessVerify=function(t,e){var r=this,n=gt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return pt.check(n,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),n=this.transactionManager.process(n),this.client.passwordless.verify(n,(function(t){return t?e(t):Tt.redirect(r.client.passwordless.buildVerifyUrl(n))}))},Ae.prototype.renderCaptcha=function(t,e,r){return function(t,e,r,n){function i(n){n=n||ke,t.getChallenge((function(t,o){return t?(e.innerHTML=r.templates.error(t),n(t)):o.required?(e.style.display="","auth0"===o.provider?function(t,e,r,n){t.innerHTML=e.templates[r.provider](r),t.querySelector(".captcha-reload").addEventListener("click",(function(t){t.preventDefault(),n()}))}(e,r,o,i):"recaptcha_v2"===o.provider&&function(t,e,r){var n=t.hasAttribute("data-wid")&&t.getAttribute("data-wid");function i(e){t.querySelector('input[name="captcha"]').value=e||""}if(n)return i(),void window.grecaptcha.reset(n);t.innerHTML=e.templates[r.provider](r);var o=t.querySelector(".recaptcha");!function(t,e,r){var n="recaptchaCallback_"+Math.floor(1000001*Math.random());window[n]=function(){delete window[n],r()};var i=window.document.createElement("script");i.src="https://www.google.com/recaptcha/api.js?hl="+e+"&onload="+n,i.async=!0,window.document.body.appendChild(i)}(0,e.lang,(function(){n=window.grecaptcha.render(o,{callback:i,"expired-callback":function(){i()},"error-callback":function(){i()},sitekey:r.siteKey}),t.setAttribute("data-wid",n)}))}(e,r,o),void n()):(e.style.display="none",void(e.innerHTML=""))}))}return r=gt.merge(Se).with(r||{}),i(n),{reload:i,getValue:function(){var t=e.querySelector('input[name="captcha"]');if(t)return t.value}}}(this.client,t,e,r)},De.prototype.buildVerifyUrl=function(t){var e,r;return pt.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),e=gt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","protocol","nonce"]).with(t),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=gt.toSnakeCase(e,["auth0Client"]),r=E(e),s(this.baseOptions.rootUrl,"passwordless","verify_redirect","?"+r)},De.prototype.start=function(t,e){var r,n;return pt.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},send:{type:"string",message:"send option is required",values:["link","code"],value_message:"send is not valid ([link, code])"},phoneNumber:{optional:!0,type:"string",message:"phoneNumber option is required",condition:function(t){return"code"===t.send||!t.email}},email:{optional:!0,type:"string",message:"email option is required",condition:function(t){return"link"===t.send||!t.phoneNumber}},authParams:{optional:!0,type:"object",message:"authParams option is required"}}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"passwordless","start"),(n=gt.merge(this.baseOptions,["clientID","responseType","redirectUri","scope"]).with(t)).scope&&(n.authParams=n.authParams||{},n.authParams.scope=n.authParams.scope||n.scope),n.redirectUri&&(n.authParams=n.authParams||{},n.authParams.redirect_uri=n.authParams.redirectUri||n.redirectUri),n.responseType&&(n.authParams=n.authParams||{},n.authParams.response_type=n.authParams.responseType||n.responseType),delete n.redirectUri,delete n.responseType,delete n.scope,n=gt.toSnakeCase(n,["auth0Client","authParams"]),this.request.post(r).send(n).end(qt(e))},De.prototype.verify=function(t,e){var r,n;return pt.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),n=gt.pick(t,["connection","verificationCode","phoneNumber","email","auth0Client"]),n=gt.toSnakeCase(n,["auth0Client"]),r=s(this.baseOptions.rootUrl,"passwordless","verify"),this.request.post(r).send(n).end(qt(e))},xe.prototype.signup=function(t,e){var r,n,i;return pt.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"},password:{type:"string",message:"password option is required"}}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"dbconnections","signup"),i=(n=gt.merge(this.baseOptions,["clientID","state"]).with(t)).user_metadata||n.userMetadata,n=gt.blacklist(n,["scope","userMetadata","user_metadata"]),n=gt.toSnakeCase(n,["auth0Client"]),i&&(n.user_metadata=i),this.request.post(r).send(n).end(qt(e))},xe.prototype.changePassword=function(t,e){var r,n;return pt.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"}}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"dbconnections","change_password"),n=gt.merge(this.baseOptions,["clientID"]).with(t,["email","connection"]),n=gt.toSnakeCase(n,["auth0Client"]),this.request.post(r).send(n).end(qt(e))},je.prototype.buildAuthorizeUrl=function(t){var e,r;return pt.check(t,{type:"object",message:"options parameter is not valid"}),e=gt.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience"]).with(t),pt.check(e,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},redirectUri:{optional:!0,type:"string",message:"redirectUri option is required"},responseType:{type:"string",message:"responseType option is required"},nonce:{type:"string",message:"nonce option is required",condition:function(t){return-1===t.responseType.indexOf("code")&&-1!==t.responseType.indexOf("id_token")}},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e.connection_scope&&pt.isArray(e.connection_scope)&&(e.connection_scope=e.connection_scope.join(",")),e=gt.blacklist(e,["username","popupOptions","domain","tenant","timeout","appState"]),e=gt.toSnakeCase(e,["auth0Client"]),e=function(t,e){var r=gt.getKeysNotIn(e,Ut);return r.length>0&&t.warning("Following parameters are not allowed on the `/authorize` endpoint: ["+r.join(",")+"]"),e}(this.warn,e),r=E(e),s(this.baseOptions.rootUrl,"authorize","?"+r)},je.prototype.buildLogoutUrl=function(t){var e,r;return pt.check(t,{optional:!0,type:"object",message:"options parameter is not valid"}),e=gt.merge(this.baseOptions,["clientID"]).with(t||{}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=gt.toSnakeCase(e,["auth0Client","returnTo"]),r=E(gt.blacklist(e,["federated"])),t&&void 0!==t.federated&&!1!==t.federated&&"false"!==t.federated&&(r+="&federated"),s(this.baseOptions.rootUrl,"v2","logout","?"+r)},je.prototype.loginWithDefaultDirectory=function(t,e){return pt.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="password",this.oauthToken(t,e)},je.prototype.login=function(t,e){return pt.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},realm:{type:"string",message:"realm option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="http://auth0.com/oauth/grant-type/password-realm",this.oauthToken(t,e)},je.prototype.oauthToken=function(t,e){var r,n;return pt.check(t,{type:"object",message:"options parameter is not valid"}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"oauth","token"),n=gt.merge(this.baseOptions,["clientID","scope","audience"]).with(t),pt.check(n,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},grantType:{type:"string",message:"grantType option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),n=gt.toSnakeCase(n,["auth0Client"]),n=function(t,e){return gt.pick(e,It)}(this.warn,n),this.request.post(r).send(n).end(qt(e))},je.prototype.loginWithResourceOwner=function(t,e){var r,n;return pt.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},connection:{type:"string",message:"connection option is required"},scope:{optional:!0,type:"string",message:"scope option is required"}}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"oauth","ro"),n=gt.merge(this.baseOptions,["clientID","scope"]).with(t,["username","password","scope","connection","device"]),(n=gt.toSnakeCase(n,["auth0Client"])).grant_type=n.grant_type||"password",this.request.post(r).send(n).end(qt(e))},je.prototype.getSSOData=function(t,e){if(this.auth0||(this.auth0=new Ae(this.baseOptions)),Tt.getWindow().location.host===this.baseOptions.domain)return this.auth0._universalLogin.getSSOData(t,e);"function"==typeof t&&(e=t),pt.check(e,{type:"function",message:"cb parameter is not valid"});var r=this.baseOptions.clientID,n=this.ssodataStorage.get()||{};this.auth0.checkSession({responseType:"token id_token",scope:"openid profile email",connection:n.lastUsedConnection,timeout:5e3},(function(t,i){return t?"login_required"===t.error?e(null,{sso:!1}):("consent_required"===t.error&&(t.error_description="Consent required. When using `getSSOData`, the user has to be authenticated with the following scope: `openid profile email`."),e(t,{sso:!1})):n.lastUsedSub&&n.lastUsedSub!==i.idTokenPayload.sub?e(t,{sso:!1}):e(null,{lastUsedConnection:{name:n.lastUsedConnection},lastUsedUserID:i.idTokenPayload.sub,lastUsedUsername:i.idTokenPayload.email||i.idTokenPayload.name,lastUsedClientID:r,sessionClients:[r],sso:!0})}))},je.prototype.userInfo=function(t,e){var r;return pt.check(t,{type:"string",message:"accessToken parameter is not valid"}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"userinfo"),this.request.get(r).set("Authorization","Bearer "+t).end(qt(e,{ignoreCasing:!0}))},je.prototype.getChallenge=function(t){if(pt.check(t,{type:"function",message:"cb parameter is not valid"}),!this.baseOptions.state)return t();var e=s(this.baseOptions.rootUrl,"usernamepassword","challenge");return this.request.post(e).send({state:this.baseOptions.state}).end(qt(t,{ignoreCasing:!0}))},je.prototype.delegation=function(t,e){var r,n;return pt.check(t,{type:"object",message:"options parameter is not valid"},{grant_type:{type:"string",message:"grant_type option is required"}}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"delegation"),n=gt.merge(this.baseOptions,["clientID"]).with(t),n=gt.toSnakeCase(n,["auth0Client"]),this.request.post(r).send(n).end(qt(e))},je.prototype.getUserCountry=function(t){var e;return pt.check(t,{type:"function",message:"cb parameter is not valid"}),e=s(this.baseOptions.rootUrl,"user","geoloc","country"),this.request.get(e).end(qt(t))},Ee.prototype.getUser=function(t,e){var r;return pt.check(t,{type:"string",message:"userId parameter is not valid"}),pt.check(e,{type:"function",message:"cb parameter is not valid"}),r=s(this.baseOptions.rootUrl,"users",t),this.request.get(r).end(qt(e,{ignoreCasing:!0}))},Ee.prototype.patchUserMetadata=function(t,e,r){var n;return pt.check(t,{type:"string",message:"userId parameter is not valid"}),pt.check(e,{type:"object",message:"userMetadata parameter is not valid"}),pt.check(r,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"users",t),this.request.patch(n).send({user_metadata:e}).end(qt(r,{ignoreCasing:!0}))},Ee.prototype.patchUserAttributes=function(t,e,r){var n;return pt.check(t,{type:"string",message:"userId parameter is not valid"}),pt.check(e,{type:"object",message:"user parameter is not valid"}),pt.check(r,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"users",t),this.request.patch(n).send(e).end(qt(r,{ignoreCasing:!0}))},Ee.prototype.linkUser=function(t,e,r){var n;return pt.check(t,{type:"string",message:"userId parameter is not valid"}),pt.check(e,{type:"string",message:"secondaryUserToken parameter is not valid"}),pt.check(r,{type:"function",message:"cb parameter is not valid"}),n=s(this.baseOptions.rootUrl,"users",t,"identities"),this.request.post(n).send({link_with:e}).end(qt(r,{ignoreCasing:!0}))};var qe={Authentication:je,Management:Ee,WebAuth:Ae,version:ot};e.default=qe}.call(this,r(2),r(94))},94:function(t,e){var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}}();var u,c=[],p=!1,h=-1;function l(){p&&u&&(p=!1,u.length?c=u.concat(c):h=-1,c.length&&f())}function f(){if(!p){var t=a(l);p=!0;for(var e=c.length;e;){for(u=c,c=[];++h1)for(var r=1;r